<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../vue/vue.js"></script>
</head>
<body>

<style>
    p{
        width: 300px;
        height: 300px;
        background: red;
    }

    .fade-enter-active, .fade-leave-active{
        transition: 1s all ease;
    }

    .fade-enter-active{
        opacity:1;
        width:300px;
        height:300px;
    }
    .fade-leave-active{
        opacity:0;
        width:50px;
        height:50px;
    }

    .fade-enter,.fade-leave{
        opacity:0;
        width:100px;
        height:100px;
    }
</style>

<div id="box">
    <input type="button" value="点击显示隐藏" @click="show=!show">
    <transition name="fade">
        <p v-show="show"></p>
    </transition>

</div>

<script>
    new Vue({
        el:'#box',
        data:{
            show:false
        }
    })
</script>

</body>
</html>